package com.rockcent.mall.lib.repository;

import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.mall.lib.domain.ProductCategories;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by DK on 16/10/10.
 */
@Repository
public interface MerchantProductCategoriesRepository extends JpaRepository<ProductCategories, Long>, JpaSpecificationExecutor,MerchantProductCategoriesRepositoryCustom {
    List<ProductCategories> findByProductId(Long productId);

    void deleteByProductId(Long productId);

    List<ProductCategories> findByProductIdIn(List<Long> productId);

    List<ProductCategories> findByCategoryIdAndIsDelete(Long categoryId, Whether no);

    List<ProductCategories> findByCategoryIdIn(List<Long> categoriesId);

}
